package com.company.Hard;

public class LK91 {
    public static void main(String[] args) {
        String  a = "qweqweqw";
    }
    public int numDecodings(String s) {
        int[] arr = new int[s.length()+1];
        arr[0] = 1;
        for(int i=1;i<arr.length;i++){
            if(s.charAt(i-1)!='0'){
                arr[i] += arr[i-1];
            }
        }
        return arr[arr.length-1];
    }
    /*/



















    int n = s.length();
        int[] arr = new int[n+1];
        arr[0] = 1;
        for(int i=1;i<=n;i++){
            if(s.charAt(i-1)!='0'){
                arr[i] += arr[i-1];
            }
            if(i>1&&s.charAt(i-2)!='0'&&(((s.charAt(i-2)-'0')*10+s.charAt(i-1)-'0')<=26)){
                arr[i] += arr[i-2];
            }
        }
        return arr[n];
     */
}
